<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    function fn(n){
        if(n === 1 || n === 2){     // 1 和 2 的斐波那契数列的值都为 1
            return 1;
        }else{
            return fn(n-1) + fn(n-2);                       // 变量更新
                                                            // var n1 = n - 1;
                                                            // var n2 = n - 2;
        }

    }
    var a =fn(9);
    console.log(a);
    

</script>
</html>